<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>multi_buffer</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__is_async_stream.html" title="is_async_stream">
<link rel="next" href="boost__beast__flat_buffer.html" title="flat_buffer">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__is_async_stream.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__flat_buffer.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__multi_buffer"></a><a class="link" href="boost__beast__multi_buffer.html" title="multi_buffer">multi_buffer</a>
</h4></div></div></div>
<p>
        <a class="indexterm" name="idm44861253255312"></a>
      </p>
<p>
        A typical multi buffer.
      </p>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.synopsis"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/core/multi_buffer.hpp" target="_top">boost/beast/core/multi_buffer.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">multi_buffer</span> <span class="special">=</span> <span class="identifier">basic_multi_buffer</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span> <span class="keyword">char</span> <span class="special">&gt;</span> <span class="special">&gt;;</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.types"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.types">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/allocator_type.html" title="basic_multi_buffer::allocator_type">allocator_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The type of allocator used.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/const_buffers_type.html" title="basic_multi_buffer::const_buffers_type">const_buffers_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The ConstBufferSequence used to represent the readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/mutable_buffers_type.html" title="basic_multi_buffer::mutable_buffers_type">mutable_buffers_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The MutableBufferSequence used to represent the writable bytes.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.member_functions"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.member_functions">Member Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/basic_multi_buffer.html" title="basic_multi_buffer::basic_multi_buffer">basic_multi_buffer</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Constructor. <br> <span class="silver">—</span><br> Move
                  Constructor. <br> <span class="silver">—</span><br> Copy
                  Constructor.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/capacity.html" title="basic_multi_buffer::capacity">capacity</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return the maximum number of bytes, both readable and writable,
                  that can be held without requiring an allocation.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/cdata.html" title="basic_multi_buffer::cdata">cdata</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns a constant buffer sequence representing the readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/clear.html" title="basic_multi_buffer::clear">clear</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Set the size of the readable and writable bytes to zero.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/commit.html" title="basic_multi_buffer::commit">commit</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Append writable bytes to the readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/consume.html" title="basic_multi_buffer::consume">consume</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Remove bytes from beginning of the readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data">data</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns a constant buffer sequence representing the readable bytes.
                  <br> <span class="silver">—</span><br> Returns a mutable
                  buffer sequence representing the readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/get_allocator.html" title="basic_multi_buffer::get_allocator">get_allocator</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns a copy of the allocator used.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/max_size.html" title="basic_multi_buffer::max_size">max_size</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Set the maximum allowed capacity. <br> <span class="silver">—</span><br>
                  Return the maximum number of bytes, both readable and writable,
                  that can ever be held.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/operator_eq_.html" title="basic_multi_buffer::operator=">operator=</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Move Assignment. <br> <span class="silver">—</span><br>
                  Copy Assignment.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare">prepare</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns a mutable buffer sequence representing writable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/reserve.html" title="basic_multi_buffer::reserve">reserve</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Guarantee a minimum capacity.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/shrink_to_fit.html" title="basic_multi_buffer::shrink_to_fit">shrink_to_fit</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Reallocate the buffer to fit the readable bytes exactly.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/size.html" title="basic_multi_buffer::size">size</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns the number of readable bytes.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/_basic_multi_buffer.html" title="basic_multi_buffer::~basic_multi_buffer">~basic_multi_buffer</a> <span class="silver">[destructor]</span></strong></span>
                </p>
              </td>
<td>
                <p>
                  Destructor.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.friends"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.friends">Friends</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__basic_multi_buffer/swap.html" title="basic_multi_buffer::swap">swap</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Exchange two dynamic buffers.
                </p>
              </td>
</tr></tbody>
</table></div>
<p>
        A dynamic buffer encapsulates memory storage that may be automatically resized
        as required, where the memory is divided into two regions: readable bytes
        followed by writable bytes. These memory regions are internal to the dynamic
        buffer, but direct access to the elements is provided to permit them to be
        efficiently used with I/O operations. The implementation uses a sequence
        of one or more byte arrays of varying sizes to represent the readable and
        writable bytes. Additional byte array objects are appended to the sequence
        to accommodate changes in the desired size. The behavior and implementation
        of this container is most similar to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span></code>.
        Objects of this type meet the requirements of <span class="emphasis"><em>DynamicBuffer</em></span>
        and have the following additional properties:
      </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
            A mutable buffer sequence representing the readable bytes is returned
            by <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">data</span></code></a> when <code class="computeroutput"><span class="keyword">this</span></code>
            is non-const.
          </li>
<li class="listitem">
            Buffer sequences representing the readable and writable bytes, returned
            by <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">data</span></code></a> and <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">prepare</span></code></a>, may have length greater
            than one.
          </li>
<li class="listitem">
            A configurable maximum size may be set upon construction and adjusted
            afterwards. Calls to <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">prepare</span></code></a> that would exceed this
            size will throw <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>.
          </li>
<li class="listitem">
            Sequences previously obtained using <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">data</span></code></a> remain valid after calls
            to <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">prepare</span></code></a> or <a class="link" href="boost__beast__basic_multi_buffer/commit.html" title="basic_multi_buffer::commit"><code class="computeroutput"><span class="identifier">commit</span></code></a>.
          </li>
</ul></div>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h4"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.template_parameters"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.template_parameters">Template
        Parameters</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Type
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <code class="computeroutput"><span class="identifier">Allocator</span></code>
                </p>
              </td>
<td>
                <p>
                  The allocator to use for managing memory.
                </p>
              </td>
</tr></tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__multi_buffer.h5"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.description"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.description">Description</a>
      </h5>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
      Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__is_async_stream.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__flat_buffer.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
